<h3>Chế độ thời gian</h3>
<hr>
<script type="text/javascript">	
  	function doDelete() {		
  		answer = confirm("Bạn chắc chắn muốn xóa chế độ thời gian này?");		
  		if(answer) {			
  			document.getElementById('frm_delete').submit();		
  		}	
  	}
 </script> 
   <style>
	td a {
		text-decoration: none;	
	}
</style>
<div style="height: 38px; border-bottom: 1px solid grey; margin-bottom: 20px; padding-right: 30px; ">
	<a onclick = "doDelete()" href="#" style="float: right">
		<img src="<?php echo base_url()?>template/backend/images/btn_delete.png" border="0" />
	</a>
	<a href="<?php echo base_url()?>index.php/time_policy/add"  style="float: right; margin-right: 20px">
		<img src="<?php echo base_url()?>template/backend/images/btn_add.png" border="0" />
	</a>
	<div class="clear: right"></div>
</div>

<form action="<?php echo base_url().'index.php/time_policy/delete'?>" method="post" enctype="multipart/form-data" id="frm_delete">
<table class="list" width="100%" cellpadding="5">
	<tr style="color: #fff; font-weight: bold" bgcolor="#ad2f33" >
		<td align="center">
			<input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" />
		</td>
		<td>Tần suất</td>
		<td>Icon</td>
		<td>Hành động</td>
	</tr>
	<?php if ($tp) { ?>
    <?php $class = 'odd_row_style'; ?>
    <?php foreach ($tp as $tp) { ?>
    <?php $class = ($class == 'even_row_style' ? 'odd_row_style' : 'even_row_style'); ?>
      
      <tr class="<?php echo $class; ?>">
		<td align="center"><input type="checkbox" name="selected[]" value="<?php echo $tp['id']; ?>" /> </td>
    	<td><?php echo $tp['value'] ?></td>
        <td><img src="<?php echo base_url() . $tp['icon']?>" style="display: block; margin: 3px" /></td>
        
    	<td align="center">
    		<!--  a href="<?php echo base_url().'index.php/customer/'. $customer['id'] ;?>">Xem-->
    		<a href="<?php echo base_url().'index.php/time_policy/update/'.$tp['id']?>">Sửa</a>
    	</td>
    </tr>
    <?php } ?>
	<?php } ?>
</table>
</form>